<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="../include/header.jsp" />
<script type="text/javascript" src="<c:url value='/htmlRes/js/jquery.form.js'/>"></script>
<script type="text/javascript" src="<c:url value='/htmlRes/js/fileUpload.js'/>"></script>
<script type="text/javaScript">
<!--
	/* pagination 페이지 링크 function */
	function listPage(){
		$('#writeForm').attr('action', '<c:url value="/currentSystem/currentSystemList.do"/>');
		$('#writeForm').submit();
	}
	
	function saveFormPage() {
		if($('#scs_excel_file').val()==""){
			alert("엑셀파일을 선택 하세요.");
			return;
		}
		$('#writeForm').attr('action', '<c:url value="/currentSystem/currentSystemExcelSave.do"/>');
		$('#writeForm').submit();
	}
	
	var fileOtions;
	$(document).ready(function(){
		fileOtions = {fileObjId:"file",fileType:"xls",toObj:"scs_excel_file",showFileInfo:"fileInfo",fileAccept:["xls","xlsx"]};
	});
-->
</script>
<!-- contents s -->
<div class="container" id="container">
	<span class="round lt">&nbsp;</span>
    <span class="round rt">&nbsp;</span>
    <span class="round lb">&nbsp;</span>
    <span class="round rb">&nbsp;</span>
    <div class="container_area">
    	<form name="writeForm" id="writeForm" action="<c:url value="/currentSystem/currentSystemList.do"/>" method="post">
			<input type="hidden" name="scs_area_key" id="scs_area_key" value="${resultVO.ssa_area_key }"/>
			<input type="hidden" name="scs_excel_file" id="scs_excel_file" value=""/>
        	<h2 class="tit_h2">설비 현황 배치 등록</h2>
            <jsp:include page="../include/navi.jsp" />
            <div class="table_wrap"><!-- D : table은 div table_wrap 싸고감 -->
                <table summary="설비 현황 배치 등록" class="table_write">
                    <caption>설비 현황 배치 등록</caption>
                    <colgroup> <!-- D : col width로 테이블 넓이 조절 -->
                        <col width="20%" />
                        <col width="*" />
                    </colgroup>
                    <tbody>
                        <tr>
                            <th scope="row">현장명</th>
                            <td class="alL">${resultVO.scc_zone_aname} / ${resultVO.ssa_area_name}</td>
                        </tr>
                        <tr>
                            <th scope="row">담당자</th>
                            <td class="alL">${resultVO.ssa_admin_name} / ${resultVO.ssa_admin_hp}</td>
                        </tr>
                        <tr>
                        	<th scope="row"><label for="file">파일 선택</label></th>
                            <td class="alL"><input type="file" name="file" id="file" style="width:90%" onchange="uploadFile(fileOtions);"/><span id="fileInfo"></span></td>
                        </tr>
                        <tr>
                        	<th scope="row">샘플 다운로드</th>
                            <td class="alL"><a href="<c:url value="/currentSystem/sampleExcelDownload.do"/>" class="file_down excel">excel_upload_sample.xls</a></td>
                        </tr>
                    </tbody>                        
                </table>
            </div><!--//table_wrap-->
            <div class="btn_bbs">
            	<a href="<c:url value='/currentSystem/currentSystemList.do' />" onclick="listPage();return false;" class="btn_wh">목록</a>
            	<a href="<c:url value="/currentSystem/currentSystemSave.do" />" onclick="saveFormPage();return false;" class="btn_re">업로드 시작</a>
            </div>
            <!-- 검색조건 유지 -->
			<input type="hidden" name="pageIndex" id="pageIndex" value="${resultVO.pageIndex }"/>
    	</form>
    </div><!--//container_area-->
</div>
<jsp:include page="../include/fileUpload.jsp" flush="true"/>
<jsp:include page="../include/footer.jsp" flush="true"/>
<jsp:include page="../include/messagealert.jsp" />